<?php
$lib_rupiah = new Format_rupiah();
?>
<div class="isi">


		 <?php  echo anchor("admin_buyshare/tambah","Buy Share","class='button' style='color:#f8f8f8'") ?>
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">Outsanding Purchase</a></li>
                <li><a href="#tabs-2">Payments Purchase</a></li>
                <li><a href="#tabs-3">Purchase Summary</a></li>
            </ul>
            <div id="tabs-1" style="padding: 10px 2px 2px 2px;">

                <table id="laporan" class="display"  >
                    <thead>
                        <tr>
                            <th>No</th>
                            <th>Order ID</th>
                            <th>Trans Date</th>
                            <th>Securities</th>
                            <th>Stock</th>
                            <th>Qty</th>
                            <th>Price</th>
                            <th>Total</th>
                            <th>Action</th>
                        </tr>            
                    </thead>
                    <tbody>
                        <?php
                        $n = 1;
                        $img_lihat = $this->lib_button->lihat_icon();
                        $img_delete = $this->lib_button->delete_icon();

                        $tgl1 = date('Y-m-d'); // 1 Oktober 2010

                        $pecah1 = explode("-", $tgl1);
                        $date1 = $pecah1[2];
                        $month1 = $pecah1[1];
                        $year1 = $pecah1[0];

                        foreach ($buyshare as $list_pesan) {
                            if ($list_pesan->status == 0) {
                                $link_lihat = anchor('admin_buyshare/edit/' . $list_pesan->orderno, $img_lihat);
                                $link_hapus = anchor('admin_buyshare/delete/' . $list_pesan->orderno, $img_delete, array('onClick' => 'return confirm(\'Apa anda yakin akan menghapus data ini ?\');'));
                                echo "<tr>";
                                echo "<td> $n </td>";
                                echo "<td> $list_pesan->orderno</td>";
                                echo "<td> $list_pesan->trandate</td>";
                                echo "<td> $list_pesan->security_code</td>";
                                echo "<td> $list_pesan->symbol</td>";
                                echo "<td> $list_pesan->quantity</td>";
                                echo "<td> $list_pesan->price</td>";
                                echo "<td align=right> " . $lib_rupiah->rupiah($list_pesan->quantity * $list_pesan->price) . "</td>";
                                echo "<td> $link_lihat $link_hapus</td>";
                                echo "</tr>";
                                $n++;
                            }
                        }
                        ?>
                    </tbody>
                </table>   

            </div>


            <div id="tabs-2" style="padding: 10px 2px 2px 2px;">
                <table id="laporan2" class="display"  >
                    <thead>
                        <tr>
                            <th>No</th>
                            <th>Order ID</th>
                            <th>Trans Date</th>
                            <th>Securities</th>
                            <th>Stock</th>
                            <th>Qty</th>
                            <th>Price</th>
                            <th>Total</th>
                            <th>Action</th>
                        </tr>  
                    <tbody>
                        <?php
                        $n = 1;
                        $img_lihat = $this->lib_button->lihat_icon();
                        $img_delete = $this->lib_button->delete_icon();

                        foreach ($buyshare as $list_pesan) {

                           if ($list_pesan->status == 1) {
                                $link_lihat = anchor('admin_buyshare/edit/' . $list_pesan->orderno, $img_lihat);
                                $link_hapus = anchor('admin_buyshare/delete/' . $list_pesan->orderno, $img_delete, array('onClick' => 'return confirm(\'Apa anda yakin akan menghapus data ini ?\');'));
                                echo "<tr>";
                                echo "<td> $n </td>";
                                echo "<td> $list_pesan->orderno</td>";
                                echo "<td> $list_pesan->trandate</td>";
                                echo "<td> $list_pesan->security_code</td>";
                                echo "<td> $list_pesan->symbol</td>";
                                echo "<td> $list_pesan->quantity</td>";
                                echo "<td> $list_pesan->price</td>";
                                echo "<td align=right> " . $lib_rupiah->rupiah($list_pesan->quantity * $list_pesan->price) . "</td>";
                                echo "<td> $link_lihat $link_hapus</td>";
                                echo "</tr>";
                                $n++;
                            }
                        }
                        ?>
                    </tbody>
                </table>                  
            </div>

            <div id="tabs-3" style="padding: 10px 2px 2px 2px;">
                <table id="laporan3" class="display"  >
                    <thead>
                        <tr>
                            <th width="5%">No</th>
                            <th width="20%">Order ID</th>
                            <th>Tgl Transaksi</th>
                            <th>Member</th>
                            <th>Biaya</th>
                            <th width="5%">Tindakan</th>
                        </tr> 
                    <tbody>
                        <?php
                        $n = 1;
                        $img_lihat = $this->lib_button->lihat_icon();
                        $img_delete = $this->lib_button->delete_icon();
                        foreach ($buyshare as $list_pesan) {
                            if ($list_pesan->status == 2) {
                                $link_lihat = anchor('admin_buyshare/edit/' . $list_pesan->id, $img_lihat);
                                $link_hapus = anchor('admin_buyshare/delete/' . $list_pesan->id, $img_delete, array('onClick' => 'return confirm(\'Apa anda yakin akan menghapus data ini ?\');'));
                                echo "<tr>";
                                echo "<td> $n</td>";
                                echo "<td> $list_pesan->id</td>";
                                echo "<td> $list_pesan->date</td>";
                                echo "<td> $list_pesan->nama_member</td>";
                                echo "<td align=right> " . $lib_rupiah->rupiah($list_pesan->grand_total) . "</td>";
                                echo "<td> $link_lihat $link_hapus</td>";
                                echo "</tr>";
                                $n++;
                            }
                        }
                        ?>
                    </tbody>
                </table>                  
            </div>            

        </div>        


    <div class="clear"></div>
</div>